//
//  KeyValuesClass.h
//  EducationAdminClient
//
//  Created by kwsdzjx on 16/8/24. 部分的方法 ， 用了 block 回调因为可能会用到回调中的数据或多余的参数所以暂时先写上部分的用的时候复制
//  Copyright © 2016年 周佳兴. All rights reserved.
//   数据字典为封装 ， 平常字段为封装

#import <Foundation/Foundation.h>
#import "EditModel.h"

@interface KeyValuesClass : NSObject
@property (strong, nonatomic)NSMutableArray *hiddenArr;
@property (strong, nonatomic)NSMutableDictionary *sendMutDic;
@property (strong, nonatomic)NSMutableDictionary *EditDic;
@property (strong, nonatomic)NSMutableArray *manyManyArr;

@property (strong, nonatomic)NSMutableDictionary *buttonDic;


@property (strong, nonatomic)void(^filter)(NSMutableDictionary *selectSchoolKeyValueDic, NSString *error);// 前提条件返回 Block

/**
 *设置隐藏字段
 */
-(void)setHiddens:(NSMutableArray *)hiddens andSendDic:(NSMutableDictionary *)sendDic andMana:(NSMutableArray *)mana andReturnBlock:(void(^)(NSMutableDictionary *send, NSMutableArray *manyman))cb;


-(void)setHiddenDataDic:(EditModel *)model;

#pragma mark - 前提条件提取
-(NSString *)textQianTiTiaoJian:(EditModel *)model andTstring:(NSString *)tString andFieldArr:(NSMutableArray *)fieldArr;
#pragma mark - 数据字典拼接获取
-(NSString *)dataDicKeyGet:(EditModel *)model orDefaultId:(NSString *)fieldId andTstring:(NSString *)tString;


-(NSString *)makeTheBaseString:(EditModel *)model andTheEditDic:(NSDictionary *)editDic;


#pragma mark - 数据字典多值选择项封装值拼接
-(void)alertOneViewUse:(NSMutableDictionary *)sendMutDic  andModel:(EditModel *)model andValues:(id)values;


#pragma mark - 弹出层键拼接
-(NSString *)getAlertKKey:(EditModel *)model andTstring:(NSString *)tString;


#pragma mark - 多选下弹层fieldOfNum
-(NSString *)getAlertMoreKKeyFieldOfNum:(EditModel *)model andTstring:(NSString *)tString;


#pragma mark - 多选下弹层键fieldOfValue
-(NSString *)getAlertMoreKKeyFieldOfValue:(EditModel *)model andNum:(NSInteger)_tNum;


#pragma mark - 前提条件设完修改前提条件
/**
 *自己清除model里的数据这里不做更改
 */
-(void)removeAlready:(EditModel *)model andTstring:(NSString *)tString andManyManyArr:(NSMutableArray *)manyManyArr andTnumBer:(NSInteger)tNum andSendMutDic:(NSMutableDictionary *)sendMutDic andEditDic:(NSMutableDictionary *)editDic andReturnBlock:(void(^)(NSMutableDictionary *send, NSMutableArray *manyman, EditModel *model))cb;

#pragma mark - 对象的内部 回调 ， 默认设置值 bing保证上传时有值不为空
-(void)whileFieldRowTypeIsspeciall:(EditModel *)model andTnum:(NSInteger )tNum andTstring:(NSString *)tString andSendMutDic:(NSMutableDictionary *)sendMutDic andManyMan:(NSMutableArray *)manyManArr andEditDetailDic:(NSMutableDictionary *)editDic andReturnBlock:(void(^)(NSMutableDictionary *send, NSMutableArray *manyman, NSDictionary *dicDEdit, EditModel *model))cb;

/**
 *数组转字符串 ， 字典转字符串 添加条件下的的的额的 && 
 */
-(NSString *)fieldDicToString:(NSArray *)arr isAdd:(BOOL)is;

/**
 *格林尼治时间改所需时间
 */
+(NSString *)dateGlinToFormate:(NSString *)date andFromate:(NSString *)formate;


/**
 *验证规则生成，如果有规则生成则规则生成返回
 */
-(void)whileHaveTmpFieldId:(EditModel *)model1 andBaseString:(NSString *)baseString andValue:(NSString *)baseValue andButtonDic:(NSDictionary *)buttonDic andSendDic:(NSDictionary *)sendDic  andNeedElseChangeArr:(NSMutableArray *)needElseChange andReturnBlock:(void(^)(NSMutableDictionary *send, EditModel *model, NSError *error))cb;

/**
 *验证必填项是否填写完成
 */
-(BOOL)textExit:(EditModel *)model andSendDic:(NSMutableDictionary *)send andMany:(NSMutableArray *)many andTnum:(NSInteger)tNum;


/**
 *验证是否是需要弹到另外的页面的字段类型 默认返回 NO 不是 弹层 等页面
 */
-(BOOL)textCanEdit:(NSInteger)num;

/**
 *调用系统打电话的功能
 */
-(void)makeThePhone:(NSString *)teleNum;

/**
 *前提条件处理
 */
-(BOOL)needFilterHave:(EditModel *)model andManyManArr:(NSArray *)_mangManArr andCurrentPageDataArr:(NSArray *)_filedArr andTString:(NSString *)tString detailDic:(NSDictionary *)_detailDic andTableId:(NSString *)tableId andSendDic:(NSDictionary *)sendDic andReturnBlock:(void (^)(NSMutableDictionary *filterDic, NSString *error))filter;

@end
